package org.hpin.asset.web;

import java.util.List;
import java.util.Map;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.hpin.asset.entity.Assetinfo;
import org.hpin.asset.service.AssetinfoService;
import org.hpin.base.usermanager.entity.Dept;
import org.hpin.common.core.SpringTool;
import org.hpin.common.core.web.BaseAction;
import org.hpin.common.util.HttpTool;
import org.hpin.common.widget.pagination.Page;
/**
 * 
 * @author Marver
 *2015-7-1下午12:24:50
 */

@Namespace("/assetinfo")
@Action("assetinfoAction")
@Results({
	@Result(name="listAssetinfo" ,location = "/WEB-INF/assetinfo/listAssetinfo.jsp"),
	@Result(name="browAssetinfo", location = "/WEB-INF/assetinfo/browAssetinfo.jsp")
	})
public class AssetinfoAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1707791165451702456L;
	private Assetinfo assetinfo;
	private AssetinfoService assetinfoService=(AssetinfoService) SpringTool.getBean(AssetinfoService.class);
	
	/**
	 * 查询总资产
	 * @return
	 */
	public String listAssetinfo() throws Exception{
		page = new Page(HttpTool.getPageNum(),HttpTool.getPageSize());
		Map searchMap = super.buildSearch();
		findByPage(page, searchMap);
		return "listAssetinfo";
	}
	public Page findByPage(Page page , Map searchMap){
		assetinfoService.findByPage(page, searchMap);
		return page ;
	}
	
	/**
	 * 查询详细信息
	 * @return
	 */
	public String browAssetinfo(){
		assetinfo=(Assetinfo) assetinfoService.findById(id);
		return "browAssetinfo";
	}
	
	
	public Assetinfo getAssetinfo() {
		return assetinfo;
	}
	public void setAssetinfo(Assetinfo assetinfo) {
		this.assetinfo = assetinfo;
	}
	
}
